Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 3 - Endpoints / Endpoints Reference
Functions / Establishing A Connection


OTRcvConnect

Reads the status of an outstanding or completed asynchronous call to the OTConnect function.

C INTERFACE
OSStatus OTRcvConnect(EndpointRef ref, Tcall* call);
C++ INTERFACE
OSStatus TEndpoint::RcvConnect(TCall* call);
PARAMETERS
ref
The endpoint reference of the endpoint initiating the connection.
call
A pointer to a TCall structure (page 3-62) that contains information about the newly established connection. When the OTRcvConnect function returns, it fills in this structure. You can set this parameter to nil, in which case no information is returned to you.
DESCRIPTION
You call the OTRcvConnect function to determine the status of a previously issued OTConnect call. If you want to retrieve information about the connection, you must allocate buffers for the addr field and, if required, the opt and udata fields before you make the call.

If the endpoint is synchronous and blocking, the OTRcvConnect function waits for the connection to be accepted or rejected. If the connection is accepted, the function returns with a kOTNoError result. If the connection is rejected, the function returns with a kOTLookErr result. In this case, you should call the OTLook function to verify that a T_DISCONNECT event is the reason for the kOTLookErr, and then you should call the OTRcvDisconnect function to clear
the event.

If the endpoint is asynchronous or nonblocking, the OTRcvConnect function returns with the kOTNoDataErr result if the connection has not yet been established.

VALID STATES
T_OUTCON

SEE ALSO
You use the OTConnect function (page 3-121) to request a connection request.

You use the TCall structure (page 3-62) to store information about the newly established connection.

You use the OTLook function (page 3-85) to retrieve pending asynchronous events.

You use the OTRcvDisconnect function (page 3-151) to acknowledge that your request for a connection has been rejected.

For information on how to use this function with a TCP/IP protocol, see page 8-17 in the TCP/IP chapter.

For information on how to use this function with AppleTalk protocols, see page 13-10 in the ADSP chapter and page 15-10 in the PAP chapter.

You examine the connect field of the TEndpointInfo structure (page 3-48) to determine whether your endpoint supports the sending of data with a connection request.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996